<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateVoteSurveyMemberAnswersTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('survey_member_answers', function(Blueprint $table)
		{
			$table->increments('id')->comment('主键');
			$table->integer('survey_member_id')->unsigned()->index('survey_member_id')->comment('用户ID');
			$table->integer('survey_id')->unsigned()->comment('问卷编号');
			$table->integer('question_id')->unsigned()->index('question_id')->comment('问题编号');
			$table->integer('option_id')->unsigned()->index('option_id')->comment('选择的答案');
			$table->text('answer_content', 65535)->index('answer_content')->comment('用户输入的答案');
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('vote_survey_member_answers');
	}

}
